package com.ly.lypopupwindowdemo.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.ly.lypopupwindowdemo.R;
import com.ly.lypopupwindowdemo.adapter.SingleAdapter2;
import com.ly.lypopupwindowdemo.adapter.SingleAdapter3;
import com.ly.lypopupwindowdemo.bean.SingleBean;

import java.util.ArrayList;
import java.util.List;

public class SingleActivity3 extends AppCompatActivity {
    RecyclerView recyclerView;
    SingleAdapter3 adapter;
    private List<SingleBean> lists = new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_single3);
        initData();
        recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        adapter = new SingleAdapter3(lists,this,recyclerView);
        recyclerView.setAdapter(adapter);
    }

    private void initData() {

        SingleBean bean1 = new SingleBean(true,"送别","朴树");
        SingleBean bean2 = new SingleBean(false,"印第安老斑鹫","周杰伦");
        SingleBean bean3 = new SingleBean(false,"一个像夏天一个像秋天","范玮琪");
        SingleBean bean4 = new SingleBean(false,"我的梦","张靓颖");
        SingleBean bean5 = new SingleBean(false,"浮夸","陈奕迅");
        SingleBean bean6 = new SingleBean(false,"其实都没有","杨宗纬");
        SingleBean bean7 = new SingleBean(false,"全世界谁倾听你","林宥嘉");
        SingleBean bean8 = new SingleBean(false,"Look What You Made Me Do","Taylar Swife");
        SingleBean bean9 = new SingleBean(false,"晴天","周杰伦");
        SingleBean bean10 = new SingleBean(false,"七里香","周杰伦");
        SingleBean bean11= new SingleBean(false,"稻香","周杰伦");
        SingleBean bean12= new SingleBean(false,"听妈妈的话","周杰伦");

        lists.add(bean1);
        lists.add(bean2);
        lists.add(bean3);
        lists.add(bean4);
        lists.add(bean5);
        lists.add(bean6);
        lists.add(bean7);
        lists.add(bean8);
        lists.add(bean9);
        lists.add(bean10);
        lists.add(bean11);
        lists.add(bean12);

    }
}
